local shouye = fk.CreateSkill{
  name = "swis__shouye",
}

Fk:loadTranslationTable{
  ["swis__shouye"] = "守业",
  [":swis__shouye"] = "摸牌阶段，你可以多摸一张牌；当你失去最后的手牌后，你失去1点体力。",
}

shouye:addEffect(fk.DrawNCards, {
  anim_type = "drawcard",
  can_trigger = function (self, event, target, player, data)
    return player:hasSkill(shouye.name) and player == target
  end,
  on_use = function (self, event, target, player, data)
    data.n = data.n + 1
  end
})

shouye:addEffect(fk.AfterCardsMove, {
  anim_type = "negative",
  can_trigger = function (self, event, target, player, data)
    if player:hasSkill(shouye.name) and player:isKongcheng() then
      for _, move in ipairs(data) do
        if move.from == player then
          for _, info in ipairs(move.moveInfo) do
            if info.fromArea == Card.PlayerHand then
              return true
            end
          end
        end
      end
    end
  end,
  on_cost = Util.TrueFunc,
  on_use = function (self, event, target, player, data)
    player.room:loseHp(player, 1, shouye.name)
  end
})

return shouye